home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
a86v302a.arc
/
03OPREQ.DOC
< prev
next >
Wrap
Text File
|
1987-04-24
|
9KB
|
205 lines
CHAPTER 3 OPERATION AND REQUIREMENTS 3-1
A86 Program Invocation
To invoke A86, you must provide a program invocation line, either
typed to the console when the DOS command prompt appears, or
included in a batch file. The program invocation line consists
of the following:
1. The program name A86.
2. The names of the source files you want to assemble. You may
use the wild-card delimiters * and ? if you wish, to denote a
group of source files to be assembled. A86 will sort all
matching names into alphabetical order for each wild-card
specification; so the files will be assembled in the same
order even if they get jumbled up within a directory.
A86 identifies the end of the source file names when it sees a
name with no extension, or a name with the default object-
extension. That extension is .COM, unless you have assembled
an ORG 0 statement; in which case the default extension is
.OBJ. Sorry, you cannot have a source file with the default
object extension.
3. You may optionally provide the word TO, to separate the source
file names from the output file names.
4. The name of the output program. If you do not provide an
extension, A86 will assume one of the following extensions:
a. .OBJ if you invoked the +O switch, for linkable-object
file production.
b. .BIN if there is no +O switch, but there is an ORG 0 in
your program.
c. .COM otherwise.
If you want your program file to have no extension, you end
the file name with a period.
You have the option to omit both the program file name and the
symbol table file name from the invocation. If you do so, A86
will output the program source.COM (or source.OBJ or
source.BIN) and the symbol table source.SYM; where "source" is
a name derived from the list of source files, according to the
rules described in the section "Strategies for Source File
Maintenance" below.
5. The name of the symbol-table file. If you do not provide an
extension, A86 will assume that you want the extension .SYM.
If you want your symbol table file to have no extension, you
end the file name with a period.
3-2
You have the option to omit the name of the symbol table file.
If you do so, A86 will use the same root as the output program
name, with a .SYM extension. If you desire no symbol table
file, specify the +S switch in your invocation line or A86
environment variable.
Assembler Switches
In addition to input and output file names, you may intersperse
assembler switch-settings anywhere after the A86 program name.
They are all acted upon immediately, no matter where they are on
the command line. Some of the switches are discussed in more
detail elsewhere; we summarize them here:
+C causes the assembler to be sensitive to upper- vs. lower-case
for all symbols, so that routines with lower-case names can
be created for linking to C programs. WARNING: I provide
only limited support for this right now. In particular, if
you use this option, you MUST give all built-in symbol names
in ALL CAPS. And D86 doesn't recognize this yet-- although
D86 will correctly disassemble symbols containing lower-case
letters, you won't be able to refer to such symbols in D86
commands, because D86 will convert your references to all-
upper-case.
-C causes A86 to ignore upper- vs. lower-case in all symbol
names.
+D causes the default base for numeric constants to be decimal,
even if the constants have leading zeroes.
-D causes the default base to be hexadecimal if there is a
leading zero; decimal otherwise.
+E causes the error-message-augmented source file to be written
to yourname.ERR within the current directory, in all cases.
With +E, A86 will never rewrite your original source file.
-E causes A86 to insert error messages into your source file,
whenever the file is in the current directory. If the file
is not in the current directory, A86 write an ERR file no
matter what the E-switch setting is.
+L causes A86 to generate a longer (3-byte) instruction form
for an unconditional JMP instruction to a forward-reference
local labels, e.g. JMP >L1. The code will usually be longer
than necessary, but you'll be spared having to occasionally
go back and code an explicit JMP LONG >L1.
-L causes A86 to generate the more efficient 2-byte form for
JMP >L1.
+O causes A86 to produce a linkable .OBJ file when the output
file name extension is not explicitly given.
-O causes A86 to produce an executable .COM file when the output
file name extension is not explicitly given.
3-3
+S suppresses the creation of the symbol-table (.SYM) file in
normal (no errors) assembly. This is overridden if you give
an explicit symbols-file name in the invocation line.
-S causes the symbol-table file to be created in all cases.
+X causes A86 to require that undefined names be explicitly
declared with an EXTRN when A86 is producing a linkable .OBJ
file. The X switch has no effect when A86 is making a .COM
file.
-X causes A86 to quietly assume that all undefined names are
valid external references.
The default setting for all the switches is "minus". Multiple
switches can be specified with a single sign; e.g. +OX is the
same as +O+X.
Switch settings can also be declared in the environment variable
A86. For example, of you execute the command SET A86=+OX while
in DOS (typically in the AUTOEXEC.BAT file run when the computer
is started), then the O and X switches will be "plus", unless
overridden with a "minus" setting in the command line.
Strategies for Source File Maintenance
A86 encourages modular programming, by letting you break your
source into separate files, with complete impunity. A86 has no
concern whatsoever for file breaks-- it treats the sequence of
files as a single source code stream.
You should consider one or more of the following strategies,
which I have adopted in my source file management:
1. I name all my A86 source files with the same extension, which
is found on no other files. The particular extension I have
chosen is ".8". I did not choose the more common .ASM; because
I have a few source-files designed for MSDOS's assembler. If
you don't like .8, I would suggest .A86.
2. I keep a separate sub-directory on my hard disk for each
multi-source-file A86 program I have. Then the simple command
"A86 *.8" performs the assembly for the current directory's
program.
3. I exploit the fact that A86 expands wild-cards into
alphabetical order. Whenever I want a source-file to be
assembled first (e.g., when it contains variable
declarations), I append a decimal digit to the start of the
file name: 0 for the first file, 1 for the second, etc., for
however many files that need to be explicitly ordered. If a
file needs to come last, I append a "Z" to the start of the
file name.
3-4
To accommodate this strategy, I have programmed A86 to a
somewhat complicated algorithm for determining the default
output file-name. I use the name of the first source file;
but I truncate the first character if it is a decimal digit.
However, you may have a general-purpose file that must come
first; so I have provided the following exception: if you have
a source-file whose name begins with the digit "9", that name
(without the 9) is used. If you don't like this, you can
always explicitly give the program name you want: "A86 *.8
MYPROG".
System Requirements for A86
A86 requires MS-DOS V2.00 or later. No BIOS or lower-level calls
are made by A86, so A86 should run on any MS-DOS machine. Please
let me know if you find this not to be the case.
To achieve its blazing speed, A86 is something of a memory hog.
A86 allocates separate segments for itself, its stack, its source
file, and its output file. A86 itself now occupies about 22K; it
always takes a full 64K for the stack. A86 splits the remaining
available memory between its source file and its output file. It
allocates a minimum of 8K apiece; and a maximum of 64K apiece.
Thus A86 requires at least 102K; but it will consume up to 214K if
available.
Careful reading of the above paragraph reveals that in a small-
memory system A86 severely limits the size of source files. But
remember that this doesn't hurt you badly: you can split up
source files with impunity. A86 assembles a sequence of files as
if it were a single source stream (similar to the INCLUDE
facility of other assemblers).